
/* GENERATED CODE:
 *  Any modifications you make are guaranteed
 *  to be deleted when this is regenerated.
 * Please edit "PROTOCOLS" inside this directory
 *
 * Names are all upper case because of "String" and "string."
 */

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using OWED.Network.Messages.General;
using OWED.Network.Messages;
using OWED.Network.Messages.Reply;


namespace OWED.Network.Messages.General
{
	public class Text: IProtocolItem 
	{
		String my_value;
		public Text (String value)
		{
			my_value = value;
		}
		public String Value { get { return my_value; } }


		public static new Text FromXml(XmlDocument xml)
		{
			XmlDocument doc;
			if (xml.SelectSingleNode("Text").FirstChild.Value != null) {
				String value = xml.SelectSingleNode("Text").FirstChild.Value;

				return new Text(value);
			}
			throw new ConnectionException("Bad document supposedly of type:Text");
		}


		public override XmlDocument ToXml()		{
			XmlDocument doc = new XmlDocument();

			doc.AppendChild(doc.CreateElement("Text"));

			if (my_value != null) {
				doc.FirstChild.AppendChild(doc.CreateTextNode(my_value));
			}

			return doc;
		}
	}
}
